<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/11/2
 * Time: 17:24
 */

namespace App\Admin\Models;

/**
 * App\Admin\Models\ContentModel
 *
 * @property int $content_id ÄÚÈÝID
 * @property int $content_type ÄÚÈÝÀàÐÍ£¬1-ÖÐÐÄ¼ò½é£¬2-´óÊÂ¼Ç£¬3-¿ÆÑÐ·½Ïò£¬4-ÐÂÎÅ£¬5-¹«¸æ£¬6-ÁªÏµÎÒÃÇ£¬7-ÕÐÆ¸ÁªÏµ·½Ê½£¬8-ÓÑÇéÁ´½Ó£¬9-Ê×Ò³ÂÖ²¥Í¼£¬10-Ñ§Êõ½²×ù£¬11-Ñ§Êõ»áÒé£¬12-Ñ§Êõ¿ìÑ¶
 * @property int|null $order ÅÅÐò
 * @property int|null $old_file_id 旧文件ID
 * @property int|null $file_id 文件ID
 * @property int|null $timeline_id Ê±¼äÏßID£¬admin_timeline_config±íÖ÷¼ü
 * @property string|null $content_date ÄÚÈÝÈÕÆÚ
 * @property string|null $content_url Ìø×ªÁ´½ÓURL
 * @property string|null $phone ÁªÏµµç»°
 * @property string|null $employee_ids ÑÐ¾¿ÈËÔ±ID´®£¬Ó¢ÎÄ¶ººÅ·Ö¸ô
 * @property string|null $image_url Ê×Í¼URL
 * @property string|null $title_zh ±êÌâ-ÖÐÎÄ
 * @property string|null $title_en ±êÌâ-Ó¢ÎÄ
 * @property string|null $introduction_zh ¼ò½é-ÖÐÎÄ
 * @property string|null $introduction_en ¼ò½é-Ó¢ÎÄ
 * @property string|null $content_zh ÕýÎÄÄÚÈÝ-ÖÐÎÄ
 * @property string|null $content_en ÕýÎÄÄÚÈÝ-Ó¢ÎÄ
 * @property string|null $presenter_zh Ö÷½²ÈËÖÐÎÄ
 * @property string|null $presenter_en Ö÷½²ÈËÓ¢ÎÄ
 * @property string|null $address_zh µØÖ·ÖÐÎÄ
 * @property string|null $address_en µØÖ·Ó¢ÎÄ
 * @property string|null $period_zh Ê±¼ä¶ÎÖÐÎÄ
 * @property string|null $period_en Ê±¼ä¶ÎÓ¢ÎÄ
 * @property \Illuminate\Support\Carbon $created_at ´´½¨Ê±¼ä
 * @property \Illuminate\Support\Carbon $updated_at ×îºó¸üÐÂÊ±¼ä
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel query()
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereAddressEn($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereAddressZh($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereContentDate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereContentEn($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereContentId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereContentType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereContentUrl($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereContentZh($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereEmployeeIds($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereFileId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereImageUrl($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereIntroductionEn($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereIntroductionZh($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereOldFileId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereOrder($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel wherePeriodEn($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel wherePeriodZh($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel wherePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel wherePresenterEn($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel wherePresenterZh($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereTimelineId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereTitleEn($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereTitleZh($value)
 * @method static \Illuminate\Database\Eloquent\Builder|ContentModel whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class ContentModel extends BaseModel
{
    protected $table = 'admin_contents';

    protected $primaryKey = 'content_id';

    protected $fillable = [
        'content_type'
    ];

    public function getEmployeeIdsAttribute($value)
    {
        return explode(',', $value);
    }

    public function setEmployeeIdsAttribute($value)
    {
        // employee_ids是字段名
        $this->attributes['employee_ids'] = implode(',', $value);
    }
}
